//
//  JLXXRecordingController.m
//  JLXXBase
//
//  Created by apple on 17/5/16.
//  Copyright © 2017年 cnsuer. All rights reserved.
//

#import "JLXXRecordingController.h"
#import "JLXXMineProductionDataSource.h"
#import "JLXXMineRecordingDataManager.h"
#import "JLXXMineGetRecording.h"
@interface JLXXRecordingController ()

@end

@implementation JLXXRecordingController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self.collectionView yzgStartRefreshing];
}

- (void)createDataSourceAndLayout{
    self.dataSource = [[JLXXMineProductionDataSource alloc]init];
    [self.dataSource addSectionItemOfCount:1];
    
    CGFloat margin = 5.0;
    YZGCollectionViewFlowLayout *layout = [[YZGCollectionViewFlowLayout alloc] initWithRowSpacing:margin columnSpacing:margin];
    self.layout = layout;
    
    self.cellClassName = @[@"JLXXMineProductionCollectionCell"];
}
-(void)createDataManager{
    self.listDataManager = [[JLXXMineRecordingDataManager alloc] initWithDelegate:self];
}
-(void)createRequest{
    JLXXMineGetRecording *getRecording = [[JLXXMineGetRecording alloc] initWithUserid:@"100000"];
    self.listDataManager.netRequest = getRecording;
}


-(void)requestDidSuccess{
    YZGCollectionSectionItem *sectionItem0 = [self.dataSource sectionItemForSection:0];
    [sectionItem0.rowItems addObjectsFromArray:self.listDataManager.responseObject];
    [self.collectionView reloadData];
}

-(void)requestDidFaile{
    
}
@end
